package com.zs.config;

import com.zs.framework.cache.StringRedisCacheImpl;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;

/**
 * Copyright 2020 ZS Network Co., Ltd. All rights reserved.
 * 本文件仅限于正数网络技术有限公司内部传阅，禁止外泄以及用于其他的商业目的。
 * Created by yuancong on 2022/10/12.
 */
@Configuration
public class RedisConfig {
    @Value("${system.fqn}")
    private String fqn;

    @Bean
    public StringRedisCacheImpl stringRedisCache(StringRedisTemplate template) {
        StringRedisCacheImpl stringRedisCache = new StringRedisCacheImpl();
        stringRedisCache.setFqn(fqn);
        stringRedisCache.setRedisTemplate(template);
        return stringRedisCache;
    }
}
